package cn.yy.pojo;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Outmatirial entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "outmatirial", catalog = "phoneerp")
public class Outmatirial implements java.io.Serializable {

	// Fields

	private Integer outMatirialId;
	private Emp emp;
	private Outmatirial outmatirial;
	private Confirm confirm;
	private Matirialunit matirialunit;
	private String outMatirialName;
	private Date outDate;
	private Integer clientId;
	private Double amount;
	private Integer accountId;
	private Set<Outmatirial> outmatirials = new HashSet<Outmatirial>(0);
	private Set<Reposity> reposities = new HashSet<Reposity>(0);

	// Constructors

	/** default constructor */
	public Outmatirial() {
	}

	/** minimal constructor */
	public Outmatirial(Emp emp, Outmatirial outmatirial, Confirm confirm,
			Matirialunit matirialunit, String outMatirialName, Date outDate,
			Integer clientId, Double amount, Integer accountId) {
		this.emp = emp;
		this.outmatirial = outmatirial;
		this.confirm = confirm;
		this.matirialunit = matirialunit;
		this.outMatirialName = outMatirialName;
		this.outDate = outDate;
		this.clientId = clientId;
		this.amount = amount;
		this.accountId = accountId;
	}

	/** full constructor */
	public Outmatirial(Emp emp, Outmatirial outmatirial, Confirm confirm,
			Matirialunit matirialunit, String outMatirialName, Date outDate,
			Integer clientId, Double amount, Integer accountId,
			Set<Outmatirial> outmatirials, Set<Reposity> reposities) {
		this.emp = emp;
		this.outmatirial = outmatirial;
		this.confirm = confirm;
		this.matirialunit = matirialunit;
		this.outMatirialName = outMatirialName;
		this.outDate = outDate;
		this.clientId = clientId;
		this.amount = amount;
		this.accountId = accountId;
		this.outmatirials = outmatirials;
		this.reposities = reposities;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "outMatirialId", unique = true, nullable = false)
	public Integer getOutMatirialId() {
		return this.outMatirialId;
	}

	public void setOutMatirialId(Integer outMatirialId) {
		this.outMatirialId = outMatirialId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "empId", nullable = false)
	public Emp getEmp() {
		return this.emp;
	}

	public void setEmp(Emp emp) {
		this.emp = emp;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "matirialTypeId", nullable = false)
	public Outmatirial getOutmatirial() {
		return this.outmatirial;
	}

	public void setOutmatirial(Outmatirial outmatirial) {
		this.outmatirial = outmatirial;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "confirmId", nullable = false)
	public Confirm getConfirm() {
		return this.confirm;
	}

	public void setConfirm(Confirm confirm) {
		this.confirm = confirm;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "unitId", nullable = false)
	public Matirialunit getMatirialunit() {
		return this.matirialunit;
	}

	public void setMatirialunit(Matirialunit matirialunit) {
		this.matirialunit = matirialunit;
	}

	@Column(name = "outMatirialName", nullable = false, length = 20)
	public String getOutMatirialName() {
		return this.outMatirialName;
	}

	public void setOutMatirialName(String outMatirialName) {
		this.outMatirialName = outMatirialName;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "outDate", nullable = false, length = 10)
	public Date getOutDate() {
		return this.outDate;
	}

	public void setOutDate(Date outDate) {
		this.outDate = outDate;
	}

	@Column(name = "clientId", nullable = false)
	public Integer getClientId() {
		return this.clientId;
	}

	public void setClientId(Integer clientId) {
		this.clientId = clientId;
	}

	@Column(name = "amount", nullable = false, precision = 22, scale = 0)
	public Double getAmount() {
		return this.amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	@Column(name = "accountId", nullable = false)
	public Integer getAccountId() {
		return this.accountId;
	}

	public void setAccountId(Integer accountId) {
		this.accountId = accountId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "outmatirial")
	public Set<Outmatirial> getOutmatirials() {
		return this.outmatirials;
	}

	public void setOutmatirials(Set<Outmatirial> outmatirials) {
		this.outmatirials = outmatirials;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "outmatirial")
	public Set<Reposity> getReposities() {
		return this.reposities;
	}

	public void setReposities(Set<Reposity> reposities) {
		this.reposities = reposities;
	}

}